- changes = version.changes.delete_if{|c| c.old_value.blank? and c.new_value.blank? }
- classes = ["log-version", "log-version-#{version.event}"]
- classes << "log-without-content" if (version.update? and changes.empty?) or !version.update?
.log{class: classes}
  - if version.creator
    .log-avatar= image_tag version.creator.avatar_url(size: avatar_size)
  .log-wrapper
    .log-symbol
    - if version.create?
      .log-heading= :created_by_ago.th(defaults)
    - elsif version.update?
      .log-heading= :updated_by_ago.th(defaults)
      - if changes.any?
        .log-body
          %ul.log-changes
            - for change in changes
              %li
                %p
                  - if change.old_value.blank?
                    = :x_has_been_updated_to_a.th(x: change.human_attribute_name, a: resource.human_changed_attribute_value(change, 'new'))
                  - elsif change.new_value.blank?
                    = :x_has_been_cleared.th(x: change.human_attribute_name, a: resource.human_changed_attribute_value(change, 'old'))
                  - else
                    = :x_has_been_updated_from_a_to_b.th(x: change.human_attribute_name, a: resource.human_changed_attribute_value(change, 'old'), b: resource.human_changed_attribute_value(change, 'new'))
    - elsif version.destroy?
      %p.log-heading= :destroyed_by_ago.th(defaults)
